AuthorizationManager

Lets the application authorize and deauthorize Mobile Payments SDK to collect payments on behalf of a Square location.

Properties

Link copied to clipboard

Snapshot of the current authorization state. The returned AuthorizationState is immutable and is NOT modified if the state changes. If you are looking for a way to track AuthorizationState, register a callback with setAuthorizationStateChangedCallback.

Link copied to clipboard

Snapshot of the AuthorizedLocation if Mobile Payments SDK is currently authorized. AuthorizedLocation is null if not authorized.

Functions

Link copied to clipboard
abstract fun authorize(token: String, locationId: String?, callback: Callback<AuthorizeResult>): CallbackReference

Asynchronously authorizes Mobile Payments SDK with an OAuth Access Token and Location ID. Applications must authorize Mobile Payments SDK before performing any other operations.

Link copied to clipboard
abstract fun deauthorize()

Deauthorizes Mobile Payments SDK. Has no effect if the SDK is already in a deauthorized state.

Link copied to clipboard

Registers a callback to be called when an authorization state changes. The supplied Callback will be called on the application UI thread when user is logged in or logged out. Important note: this callback will be called AFTER the authorization callback supplied to authorize.